package com.shuoyue.ycgk.ui.questionbank.practice;

import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;

import com.chad.library.adapter.base.BaseViewHolder;
import com.shuoyue.ycgk.R;
import com.shuoyue.ycgk.base.baseadapter.AppBaseQuickAdapter;
import com.shuoyue.ycgk.entity.QuestionSimple;

import java.util.List;

public class QuestionSpecialCountAdapter extends AppBaseQuickAdapter<QuestionSimple> {
    public QuestionSpecialCountAdapter(@Nullable List<QuestionSimple> data) {
        super(R.layout.item_question_count, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, QuestionSimple item) {
        helper.addOnClickListener(R.id.numtext);
        helper.setText(R.id.numtext, item.getNum() + "");
        if (item.getIsAnswerRight() == 1) {
            helper.setTextColor(R.id.numtext, ContextCompat.getColor(mContext, R.color.themeColor));
        } else if (item.getIsAnswerRight() == 0) {
            helper.setTextColor(R.id.numtext, ContextCompat.getColor(mContext, R.color.option_text_is_right_orange));
        } else {
            helper.setTextColor(R.id.numtext, ContextCompat.getColor(mContext, R.color.text_sub_title));
        }
    }
}
